Skip to content

fix(otel): emit trace_output as span attribute instead of event#9255

Merged
DOsinga merged 1 commit into
mainfrom
fix/8586-otel-trace-output-span-attr
May 18, 2026
Merged

fix(otel): emit trace_output as span attribute instead of event#9255
DOsinga merged 1 commit into
mainfrom
fix/8586-otel-trace-output-span-attr

Conversation

@DOsinga
Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga commented May 15, 2026

Summary

trace_output was emitted via tracing::info!() which becomes an OTEL event (a log line attached to the span), not a span attribute. Observability backends like MLflow and Langfuse (via OTEL ingestion) look for span attributes to populate input/output fields, so the assistant output was invisible to them.

Changes

  • Declare trace_output as a field on reply_stream_span so it can accept a recorded value
  • Replace tracing::info!(trace_output = ...) with tracing::Span::current().record("trace_output", ...) to set it as a proper span attribute

The Langfuse custom layer's on_record and on_event both call handle_record with the same metadata, so this change is transparent to the Langfuse-specific path.

Fixes #8586

trace_output was emitted via tracing::info!() which becomes an OTEL
event (log line on the span), not a span attribute. Observability
backends like MLflow and Langfuse (via OTEL ingestion) look for span
attributes, so the output was invisible to them.

Declare trace_output as a field on reply_stream_span and use
Span::record() so it becomes a proper OTEL span attribute. The
Langfuse custom layer handles both paths identically (on_record and
on_event both call handle_record), so this is a no-op for that path.

Fixes #8586

Signed-off-by: Douwe Osinga <douwe@squareup.com>
@DOsinga DOsinga added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit 3a2f4ea May 18, 2026
20 of 22 checks passed
@DOsinga DOsinga deleted the fix/8586-otel-trace-output-span-attr branch May 18, 2026 15:15
michaelneale added a commit that referenced this pull request May 19, 2026
* origin/main: (160 commits)
  Add Linux musl CLI builds (#9240)
  feat(acp): paginate session list (#9199)
  docs: reorganize (#9310)
  Structured per-provider config block, non-destructive provider switching (#8977)
  feat(cli): add `goose review` local code review command (#9114)
  feat(tui): diff viewer (#9260)
  fix(otel): emit trace_output as span attribute instead of event (#9255)
  docs: add guide for connecting goose Desktop to a remote goosed server (#9275)
  fix(config): check file fallback when keyring has no entry (#9279)
  fix(desktop): ScheduleModal error message styling (#9278)
  fix(ui): align sidebar hamburger in macOS fullscreen (#9257)
  Add documentation for new provider SaladCloud AI Gateway (#9253)
  fix: use current_exe() instead of PATH lookup when spawning goose (#9236)
  fix(extension_manager): set TCP_USER_TIMEOUT on streamable HTTP clients (#9207)
  fix: activate custom provider after adding via configure (#9213)
  Flush OTLP traces reliably on exit with configurable timeout (#9228)
  fix: reduce excessive MISSING_TRANSLATION warnings for fallback locales (#9294)
  feat(acp): pass session cwd param to acp providers (#9229)
  fix(desktop): eliminate cross-window deep link contamination (#9273)
  fix: improve Telegram gateway error reporting and connection reliability (#9223)
  ...

Signed-off-by: Michael Neale <michael.neale@gmail.com>

# Conflicts:
#	crates/goose/src/agents/agent.rs
#	crates/goose/tests/agent.rs
lifeizhou-ap added a commit that referenced this pull request May 20, 2026
* main: (70 commits)
  Feat/summon subagent instructions (#9325)
  feat: open-plugins generalization + skills (#9112)
  feat(hooks): PreToolUse denial (#9304)
  Add support for optional api_key configuration for declarative openai-engine providers (#9202)
  fix(cli): use plain '> ' prompt instead of goose emoji (#9305)
  flag for login shell PATH (#9313)
  Remove popular chat topics from new chat screen (#9307)
  fix: stop killing goosed when a window closes (#9302)
  Remove vendored Windows binaries (#9318)
  Add Linux musl CLI builds (#9240)
  feat(acp): paginate session list (#9199)
  docs: reorganize (#9310)
  Structured per-provider config block, non-destructive provider switching (#8977)
  feat(cli): add `goose review` local code review command (#9114)
  feat(tui): diff viewer (#9260)
  fix(otel): emit trace_output as span attribute instead of event (#9255)
  docs: add guide for connecting goose Desktop to a remote goosed server (#9275)
  fix(config): check file fallback when keyring has no entry (#9279)
  fix(desktop): ScheduleModal error message styling (#9278)
  fix(ui): align sidebar hamburger in macOS fullscreen (#9257)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

not emitting the fields in a way that observability integrations would use as input/output

2 participants